package com.lemon.conf.redis.custom;


import java.lang.reflect.Method;
import java.util.Arrays;

/**
 * <p>
 * Title:
 * </p>
 * <p>
 * Description: 标记了缓存注解的方法类信息
 * 用于主动刷新缓存时调用原始方法加载数据
 * </p>
 * <p>
 * Company:
 * </p>
 * 
 * @author Ran_cc
 * @date 2018年5月29日
 * @版本 V 1.0
 */
public final class CachedInvocation {

    private Object key;
	private Object targetBean;
	private Method targetMethod;
    private Object[] arguments;
	private String targetMethodName;


	public CachedInvocation() {
	}

	public CachedInvocation( Object key, Object targetBean, Method targetMethod, Object [] arguments, String targetMethodName ) {
        this.key = key;
        this.targetBean = targetBean;
        this.targetMethod = targetMethod;
        if (arguments != null && arguments.length != 0) {
            this.arguments = Arrays.copyOf(arguments, arguments.length);
        }
		this.targetMethodName = targetMethodName;
    }

    public Object[] getArguments() {
        return arguments;
    }

    public Object getTargetBean() {
        return targetBean;
    }

    public Method getTargetMethod() {
        return targetMethod;
    }

    public Object getKey() {
        return key;
    }

	public String getTargetMethodName() {
		return this.targetMethodName;
	}

}

